﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ArtOfTest.WebAii.Controls.HtmlControls;

namespace SM2SetupOptions
{
    public class DictionaryActions
    {
        public static Boolean is_dictionary_loaded()
        {
            try
            {
                Utilities.GlobalObject.MANAGER.ActiveBrowser.RefreshDomTree();
                HtmlDiv cphPageContent_upGeneral = Utilities.GlobalObject.MANAGER.ActiveBrowser.Find.ById<HtmlDiv>("cphPageContent_upGeneral");
                HtmlDiv cphPageContent_pnlLingoDictionary = cphPageContent_upGeneral.Find.ById<HtmlDiv>("cphPageContent_pnlLingoDictionary");
                HtmlDiv cphPageContent_pnlDictionaryEntriesScroller = cphPageContent_pnlLingoDictionary.Find.ById<HtmlDiv>("cphPageContent_pnlDictionaryEntriesScroller");
                HtmlTable cphPageContent_gvDictionaryEntries = cphPageContent_pnlDictionaryEntriesScroller.Find.ById<HtmlTable>("cphPageContent_gvDictionaryEntries");

                int intCountRows = cphPageContent_gvDictionaryEntries.Rows.Count;
                if (intCountRows > 0) return true;
                else return false;
            }
            catch
            {
                return false;
            }
        }
    }
}
